<template>
<div>
   <topnav :topData="topData"/>  
   <Fenlei />  
</div>

</template>

<script>
//先引用--封装好的link.js
import link from "@/api/link.js";
import topnav from "@/components/life/shouye/topnav.vue"
import Fenlei from "@/components/life/shouye/fenlei.vue"
export default {
 components:{
    topnav,
    Fenlei
  },
    data() {
    return {
      topData: [],
      fenleiData:[]

    };
  },
  //需要自动发送请求---路由钩子
  mounted() {
    //调用link---发送请求；（“地址”，“请求方式”）---默认get不写
    link("user/link/datamock").then(({ data }) => {
      console.log(data);
      this.topData = data.topData;
       this.fenleiData = data.fenleiData;
    });
  },
}
</script>

<style>

</style>